<%--
  User: Aleksey
  Date: 18.02.2009
  Time: 13:43:35
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="f" uri="http://java.sun.com/jsf/core" %>
<%@ taglib prefix="h" uri="http://java.sun.com/jsf/html" %>
<%@ taglib prefix="corejsf" uri="http://corejsf.com/pager" %>
<html>
<link rel="icon" href="favicon.ico" type="image/x-icon">
<f:view locale="#{localeManager.locale}">
    <f:loadBundle var="msgs" basename="messages"/>
    <head>
        <title><h:outputText value="#{msgs['title']}"/></title>
        <link href="olga.css" rel="stylesheet" type="text/css">
    </head>
    <body>
    <h:form id="formsubmissions">
        <%@include file="logoPanel.jspf" %>
        <%@include file="navigationPanel.jspf" %>
        <h3><h:commandLink action="submissions">Refresh</h:commandLink></h3>

        <h3>
            <h:dataTable id="submissionstable" value="#{data.submissions}" var="item" styleClass="tableStyle" rows="30">
                <h:column headerClass="columnHeader">
                    <f:facet name="header"><h:outputText value="ID"/></f:facet>
                    <h:outputText value="#{item.id}"/>
                </h:column>
                <%--<h:column headerClass="columnHeader">
                    <f:facet name="header"><h:outputText value="Date"/></f:facet>
                    <h:outputText value="#{item.submitted}"/>
                    <h:outputFormat value="{0}">
                        <f:convertDateTime type="DATE" pattern="MM/dd/yyyy" />
                        <f:param value="#{item.submitted}"/>
                    </h:outputFormat>
                </h:column>--%>
                <h:column headerClass="columnHeader">
                    <f:facet name="header"><h:outputText value="User"/></f:facet>
                    <h:outputText value="#{item.authorFullname}"/>
                </h:column>
                <h:column headerClass="columnHeader">
                    <f:facet name="header"><h:outputText value="Problem"/></f:facet>
                    <h:outputText value="#{item.problem.name}"/>
                </h:column>
                <h:column headerClass="columnHeader">
                    <f:facet name="header"><h:outputText value="Status"/></f:facet>
                    <h:outputText style="font-weight: bold; color: #{item.color}" value="#{item.status}"/>
                </h:column>
                 <h:column headerClass="columnHeader">
                    <f:facet name="header"><h:outputText value="Plag"/></f:facet>
                    <h:outputText style="font-weight: bold; color: #{item.plagColor}" value="#{item.plagStatus}"/>
                </h:column>
                <h:column headerClass="columnHeader">
                    <f:facet name="header"><h:outputText value="Test #"/></f:facet>
                    <h:commandLink action="#{data.showSubmissionTest}" value="#{item.test}">
                        <f:param name="problem" value="#{item.problem.id}"/>
                        <f:param name="test" value="#{item.test}"/>
                        <f:param name="status" value="#{item.status}"/>
                    </h:commandLink>
                </h:column>
                <%--<h:column headerClass="columnHeader">
                    <f:facet name="header"><h:outputText value="Time"/></f:facet>
                    <h:outputText value="#{item.time * 0.001}"/>
                </h:column>--%>
                <h:column headerClass="columnHeader">
                    <f:facet name="header"><h:outputText value="Language"/></f:facet>
                    <h:outputText value="#{item.compiler}"/>
                </h:column>
                <%--<h:column headerClass="columnHeader">
                    <f:facet name="header"><h:outputText value="File name"/></f:facet>
                    <h:outputText value="#{item.filename}"/>
                </h:column>--%>
                <h:column headerClass="columnHeader">
                    <f:facet name="header"><h:outputText value="Source"/></f:facet>
                    <h:commandLink action="#{data.showSubmissionSource}" value="Source">
                        <f:param name="submission" value="#{item.id}"/>
                    </h:commandLink>
                </h:column>
            </h:dataTable>
            <corejsf:pager dataTableId="submissionstable" showpages="5" selectedStyleClass="currentPage"/>
        </h3>
    </h:form>
    </body>
</f:view>
</html>